package chapter24

/**
 * Created by alex on 15-4-17.
 */
object RegexDemo extends App {

  val Decimal = """(-)?(\d+)(\.\d*)?""".r

  val Decimal(sign,integerpart,decimalpart) = "-1.23"

  val input = "for -1.0 to 99 to 3"

  for (Decimal(s,i,d) <- Decimal findAllIn input)
    println(s +": "+  i+": " + d)
}
